package guowenlong.golf.ui.personal.changephone.step_three;

import guowenlong.golf.C;
import guowenlong.golf.entity.RegistEntity;
import rx.Observer;

/**
 * des   : 描述 author: Gavin email : guowenlong20000@gmail.com time  : 2016年09月13日 下午 6:26.
 */
public class StepThreePresenter extends StepThreeContract.Presenter {


  @Override
  public void onStart() {

  }

  @Override
  public void create(String phone_number, String code, String password) {
    mRxManager
        .add(mModel.create(phone_number, code, password).subscribe(new Observer<RegistEntity>() {
          @Override
          public void onCompleted() {

          }

          @Override
          public void onError(Throwable e) {

          }

          @Override
          public void onNext(RegistEntity registEntity) {
            if (registEntity.getStatus() == C.RESULT_OK) {
              mView.createSuccess(registEntity);
            } else if (registEntity.getStatus() == C.RESULT_ERROR) {
              mView.createError(registEntity);
            }
          }
        }));
  }
}